<template>
    <view class="main">
        <view class="se" v-if="orderDetail.addr">
            <serverCard :data="orderDetail.addr" />
        </view>
        <view class="desc">
            <view class="con">{{ orderDetail.detail }}</view>
            <view class="img-list" v-if="orderDetail.image">
                <image :src="item" v-for="item in orderDetail.image.split(',')" :key="item" mode="aspectFill" />
            </view>
        </view>
    </view>
</template>

<script setup>
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';
import serverCard from '@/components/serverCard/serverCard.vue';
import { logDetail } from '@/api/apiList'

const id = ref('')
const aId = ref('')
onLoad((option) => {
    id.value = option.id
    aId.value = option.aId
    uni.setNavigationBarTitle({
        title: option.time + '日志'
    })
    getOrder()
})


const show = ref(true)
const orderDetail = ref({})
const getOrder = async () => {
    const res = await logDetail({ id: id.value, addrId: aId.value })
    if (res.code == 200) {
        orderDetail.value = res.data
        show.value = false
    }
}
</script>
<style lang="scss" scoped>
.main {
    padding: 30rpx;

    .se {
        margin-bottom: 20rpx;
    }

    .desc {
        background: #FFFFFF;
        border-radius: 12rpx;
        padding: 30rpx;

        .con {
            font-family: PingFang-SC, PingFang-SC;
            font-weight: 500;
            font-size: 28rpx;
            color: #222222;
            line-height: 48rpx;
        }

        .img-list {
            image {
                margin: 10rpx;
                width: 190rpx;
                height: 190rpx;
                border-radius: 12rpx;
            }
        }
    }
}
</style>